Replication archive for "News Diffusion in Social Networks and Stock Market
Reactions" by David Hirshleier, Lin Peng, and Qiguang Wang

In what follows I describe how to replicate the tables and figures in "News
Diffusion in Social Networks and Stock Market Reactions". There are two folders
in the replication archive. Folder 'scr' contains Matlab, SAS, and Stata codes.
Folder 'data' contains the pseduo final sample datasets. The structure of this
archive and the description of each file are as follows.

├── Readme.txt
├── data
│   ├── odean_hhnew_pseudo.dta: pseudo household sample, corresponding to the output by Household-Sample.sas
│   └── sue_sample_pseudo.dta: pseudo earnings sample, corresponding to the output by Main-Sample.sas
└── scr
    ├── DepVars
    │   ├── 0-CEN.m: matlab script to compute county-level centrality
    │   ├── 1-sue.sas: generate earnings-related variables
    │   ├── 2-dgtw.sas: generate DGTW assignments and portfolio returns
    │   ├── 3-CAR-VOL-Persistence.sas: generate CAR[s, t], LNVOL[s, t], volatility persistence, and volume persistence
    │   ├── 4-StockTwits.sas: generate StockTwits ANM[s, t], ARM[s, t], DIS[s, t], disagreement persistence, and StockTwits centrality SCEN
    │   ├── 5-GoogleSVI.sas: generate Google SVI ASV[s, t] and persistence
    │   ├── 6-Controls.sas: generate stock-level control variables 
    │   ├── 7-Demographcis.sas: generate demographic variables at the county-level
    │   └── 8-Historical-Headquarters-Addresses.sas: clean historical headquarters addresses
    ├── Sample
    │   ├── Household-Sample.sas: cleans up the brokerage data and compile the sample for Table 9
    │   └── Main-Sample.sas: combine all dependent variables and controls for the earnings sample
    └── Tests
        ├── All-Other-Tables.do: generate Tables 1-8 and Table 10
        ├── Figure.py: generate Figure 1
        └── Table9.do: generate Table 9

To replicate the results, first run the files sequentially in scr/DepVars, then
run Main-Sample.sas in scr/Sample/ folder, which will generate sue_sample.dta,
the main dataset used for all tables other than Table 9. To replilcate these
tables, simply run scr/Tests/All-Other-Tables.do.

The household sample is generated by running Household-Sample.sas in scr/Sample/
The household sample is used to generate Table 9, which can be replicated by
running Table9.do in scr/Tests/. 

Figure 1 can be replicated by running Figure.py in scr/Tests/.

Please note that the replication archive does not contain the raw data. Our
stock-level data is from CRSP, earnings and accounting data is from Compustat,
and county-level demographics are from the U.S. Census 2000 and 2010 and
AAmerican Community Survey. The 2016 Facebook SCI data is obtained from an
confidential agreement with Facebook. The Google SVI data is obtained through
Google Trend's academic API. 
